-
Notifications
You must be signed in to change notification settings - Fork 158
Common: allow access to the reference comparator plots in derived classes #2578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Common: allow access to the reference comparator plots in derived classes #2578
Conversation
5c9975f to
9ba37f8
Compare
|
@Barthelemy @knopers8 @justonedev1 this is another PR related to the reference comparator task. I am preparing another PR for the MCH code that will make use of the new functionality introduced here, that is to compare some plots with their references within the post-processing task that creates the plots, without having to run a dedicated ReferenceComparatorTask (and without extra traffic to the QCDB). |
Barthelemy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea !
I have just added a couple of trivial comments.
| static TH1* getRatioPlotFromCanvas(TCanvas* canvas) | ||
| { | ||
| // Get the pad containing the current histogram, as well as the reference one in the case of 1-D plots | ||
| TPad* padHistRatio = (TPad*)canvas->GetPrimitive(TString::Format("%s_PadHistRatio", canvas->GetName())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not a dynamic_cast ?
| static std::pair<TH1*, TH1*> getPlotsFromCanvas(TCanvas* canvas, std::string& message) | ||
| { | ||
| // Get the pad containing the current histogram, as well as the reference one in the case of 1-D plots | ||
| TPad* padHist = (TPad*)canvas->GetPrimitive(TString::Format("%s_PadHist", canvas->GetName())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not a dynamic_cast ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Barthelemy indeed, a dynamic cast is better.
Regarding the ReferenceUtils.h, is there a specific reason why the getReferencePlot() function was implemented as static? I did the same for the other two functions added here, but I am not 100% sure this is what you had in mind...
…asses The changes allow to use the ReferenceComparatorTask as a base class, providing access to the reference comparison plots for the derived classes. A typical use case would be a post-processing task that produces some derived plots, which also need to compared with some reference. With the current production code, this involves adding a dedicated ReferenceComparatorTask in the workflow, that fetches the plots from the post-processing task from the QCDB. This commit allows to solve the above problem by deriving the post-processing task from the ReferenceComparatorTask, such that the reference comparison plots can be filled directly by the derived task, without going through the QCDB. This is achieved with the following two changes: * addition of a function that exposes the reference comparison plots in the ReferenceComparatorTask interface * storage of the pointer to the reference histogram in the ReferenceComparatorPlot object, such that it does not need to be passed to the `update()` method
Add to the ReferenceUtils.h header file the functions that allow to access the current, reference and ratio plots from the TCanvas created by the ReferenceComparartorPlot class. This will allow for example custom checkers to access the plots.
9ba37f8 to
e40c600
Compare
The commit adds plots with quantities averaged over SOLAR links, similar to the existing ones as function of Detection Elements. It also adds comparisons of DE and SOLAR plots with reference ones, using the code from AliceO2Group#2578
* [MCH] added averaging over SOLAR links Added computation of average quantities over SOLAR links, similar to what is already implemented for the averaging over Detection Elements * [MCH] added helper functions for handling SOLAR indexes and histogram decorations * [MCH] updated Pedestals Task histogram decorations The changes are needed to sync with the updated helper code * [MCH] added plots as function of SOLAR links The commit adds plots with quantities averaged over SOLAR links, similar to the existing ones as function of Detection Elements. It also adds comparisons of DE and SOLAR plots with reference ones, using the code from #2578 * [MCH] added checkers for SOLAR-based plots The code that checks the SOLAR-based plots is similar to that for the DE-based ones. The checkers also fill a summary plot with the overall quality of each SOLAR link, which are then aggregared by a dedicated task. * [MCH] added aggregator task for DE and SOLAR qualities The task combines the summary qualities for each DE and SOLAR link, and uploads a CCDB object with the list of bad DE and SOLAR IDs. The CCDB objects will be used to automatically reconfigure the bad links during the data taking. * [MCH] fixed clang errors * [MCH] added review suggestions
* [MCH] added averaging over SOLAR links Added computation of average quantities over SOLAR links, similar to what is already implemented for the averaging over Detection Elements * [MCH] added helper functions for handling SOLAR indexes and histogram decorations * [MCH] updated Pedestals Task histogram decorations The changes are needed to sync with the updated helper code * [MCH] added plots as function of SOLAR links The commit adds plots with quantities averaged over SOLAR links, similar to the existing ones as function of Detection Elements. It also adds comparisons of DE and SOLAR plots with reference ones, using the code from #2578 * [MCH] added checkers for SOLAR-based plots The code that checks the SOLAR-based plots is similar to that for the DE-based ones. The checkers also fill a summary plot with the overall quality of each SOLAR link, which are then aggregared by a dedicated task. * [MCH] added aggregator task for DE and SOLAR qualities The task combines the summary qualities for each DE and SOLAR link, and uploads a CCDB object with the list of bad DE and SOLAR IDs. The CCDB objects will be used to automatically reconfigure the bad links during the data taking. * [MCH] fixed clang errors * [MCH] added review suggestions
* [MCH] added averaging over SOLAR links Added computation of average quantities over SOLAR links, similar to what is already implemented for the averaging over Detection Elements * [MCH] added helper functions for handling SOLAR indexes and histogram decorations * [MCH] updated Pedestals Task histogram decorations The changes are needed to sync with the updated helper code * [MCH] added plots as function of SOLAR links The commit adds plots with quantities averaged over SOLAR links, similar to the existing ones as function of Detection Elements. It also adds comparisons of DE and SOLAR plots with reference ones, using the code from #2578 * [MCH] added checkers for SOLAR-based plots The code that checks the SOLAR-based plots is similar to that for the DE-based ones. The checkers also fill a summary plot with the overall quality of each SOLAR link, which are then aggregared by a dedicated task. * [MCH] added aggregator task for DE and SOLAR qualities The task combines the summary qualities for each DE and SOLAR link, and uploads a CCDB object with the list of bad DE and SOLAR IDs. The CCDB objects will be used to automatically reconfigure the bad links during the data taking. * [MCH] fixed clang errors * [MCH] added review suggestions
The changes in the PR allow to use the ReferenceComparatorTask as a base class, providing access to the reference comparison plots for the derived classes.
A typical use case would be a post-processing task that produces some derived plots, which also need to compared with some reference.
With the current production code, this involves adding a dedicated ReferenceComparatorTask in the workflow, that fetches the plots from the post-processing task from the QCDB.
This commit allows to solve the above problem by deriving the post-processing task from the ReferenceComparatorTask, such that the reference comparison plots can be filled directly by the derived task, without going through the QCDB.
This is achieved with the following two changes:
update()methodThe PR also adds to the ReferenceUtils.h header file the functions that allow to access the current, reference and ratio plots from the TCanvas created by the ReferenceComparartorPlot class.
This is for example needed to allow custom checkers to access the output of the reference comparison.